package Test5;


    public class IllegalIndexException extends Exception {
        private final int rowIndex;
        private final int colIndex;

        public IllegalIndexException(int rowIndex, int colIndex) {
            this.rowIndex = rowIndex;
            this.colIndex = colIndex;
        }

        @Override
        public String toString() {
            return "IllegalIndexException: Row index " + rowIndex + " or column index " + colIndex + " is out of bounds.";
        }
    }



